<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="model.*"%>
<%
	VenueModel obj;
	Object temp = request.getAttribute("document");
	if (temp != null) {
		try {
			obj = (VenueModel) temp;
		} catch (Exception ex) {
			obj = new VenueModel();
		}
	} else {
		obj = new VenueModel();
	}
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Update Venue </title>
<script language="javascript" type="text/javascript"
	src="js/datepicker.js"></script>
<link rel="stylesheet" href="css/datepicker.css" />
<link rel="stylesheet" href="css/common.css" />
<script language="javascript" type="text/javascript" src="js/common.js"></script>
<script language="javascript" type="text/javascript"
	src="js/jquery-1.6.1.min.js"></script>

<script language="javascript" type="text/javascript">
	var requiredInputs = [['code','code_required'],['description','description_required'],['id_company','id_company_required'],['abb_name','abb_name_required'],['short_name','short_name_required'],['foreign_name','foreign_name_required'],['address','address_required'],['mobile','mobile_required'],['capacity','capacity_required'],['status','status_required'],['notification','notification_required']];
	var intInputs = [['id_company','id_company_invalid'],['capacity','capacity_invalid'],['status','status_invalid'],['notification','notification_invalid']];
	var doubleInputs = [];
	var dateInputs = [];
	var timeInputs = [];

	function checkInputs() {
		var valid = true;

		if (checkRequiredInputs(requiredInputs) == false) {
			valid = false;
		}
		if (checkIntInputs(intInputs) == false) {
			valid = false;
		}
		if (checkDoubleInputs(doubleInputs) == false) {
			valid = false;
		}
		if (checkDateInputs(dateInputs) == false) {
			valid = false;
		}
		if (checkTimeInputs(timeInputs) == false) {
			valid = false;
		}

		// SPECIFIC VALIDATE CODE HERE		

		return valid;
	}
</script>
</head>
<body>
	<form action="venueServlet?mode=insert" method="post"
        onSubmit="return checkInputs()"
        onreset="return confirm('Do you really want to reset the form?')">
		<table class="tblInput" border="1">
			<tr class="inputHeader">
				<td colspan="3" class="inputHeader">Create New Venue </td>
			</tr>
			<tr class="trField">
				<td class="tdFieldName">Id </td>				<td class="tdFieldInput">
					<input class="inputInt" type="text" id="id" name="id" readonly="readonly" value="<%=obj.getId()%>" />
				</td>
				<td class="tdErrMsg">					
                </td>			<tr class="trField">
				<td class="tdFieldName">Name </td>			    <td class="tdFieldInput">
					<input class="inputText" type="text" id="name" name="name" maxlength="255" value="<%=obj.getName()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="name_required" class="errMsg" style="display: none;">Name  is required</span>
					<span id="name_invalid" class="errMsg" style="display: none;">Name  is invalid</span>
                    <span id="name_error" class="errMsg"><%=obj.errMsgs.Name%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Code </td>			    <td class="tdFieldInput">
					<input class="inputText" type="text" id="code" name="code" maxlength="20" value="<%=obj.getCode()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="code_required" class="errMsg" style="display: none;">Code  is required</span>
					<span id="code_invalid" class="errMsg" style="display: none;">Code  is invalid</span>
                    <span id="code_error" class="errMsg"><%=obj.errMsgs.Code%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Description </td>				    <td class="tdFieldInput">
					<textarea id="description" name="description" rows="5" class="inputTextarea"><%=obj.getDescription()%></textarea>
				</td>
				<td class="tdErrMsg">
					<span id="description_required" class="errMsg" style="display: none;">Description  is required</span>
					<span id="description_invalid" class="errMsg" style="display: none;">Description  is invalid</span>
                    <span id="description_error" class="errMsg"><%=obj.errMsgs.Description%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Id Company </td>				<td class="tdFieldInput">
					<input class="inputInt" type="text" id="id_company" name="id_company" maxlength="10" value="<%=obj.getIdCompany()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="id_company_required" class="errMsg" style="display: none;">Id Company  is required</span> 
					<span id="id_company_invalid" class="errMsg" style="display: none;">Id Company  is invalid</span>
                    <span id="id_company_error" class="errMsg"><%=obj.errMsgs.IdCompany%></span>
                </td></tr>
			<tr class="trField">
				<td class="tdFieldName">Abb Name </td>			    <td class="tdFieldInput">
					<input class="inputText" type="text" id="abb_name" name="abb_name" maxlength="10" value="<%=obj.getAbbName()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="abb_name_required" class="errMsg" style="display: none;">Abb Name  is required</span>
					<span id="abb_name_invalid" class="errMsg" style="display: none;">Abb Name  is invalid</span>
                    <span id="abb_name_error" class="errMsg"><%=obj.errMsgs.AbbName%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Short Name </td>			    <td class="tdFieldInput">
					<input class="inputText" type="text" id="short_name" name="short_name" maxlength="25" value="<%=obj.getShortName()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="short_name_required" class="errMsg" style="display: none;">Short Name  is required</span>
					<span id="short_name_invalid" class="errMsg" style="display: none;">Short Name  is invalid</span>
                    <span id="short_name_error" class="errMsg"><%=obj.errMsgs.ShortName%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Foreign Name </td>			    <td class="tdFieldInput">
					<input class="inputText" type="text" id="foreign_name" name="foreign_name" maxlength="255" value="<%=obj.getForeignName()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="foreign_name_required" class="errMsg" style="display: none;">Foreign Name  is required</span>
					<span id="foreign_name_invalid" class="errMsg" style="display: none;">Foreign Name  is invalid</span>
                    <span id="foreign_name_error" class="errMsg"><%=obj.errMsgs.ForeignName%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Address </td>			    <td class="tdFieldInput">
					<input class="inputText" type="text" id="address" name="address" maxlength="255" value="<%=obj.getAddress()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="address_required" class="errMsg" style="display: none;">Address  is required</span>
					<span id="address_invalid" class="errMsg" style="display: none;">Address  is invalid</span>
                    <span id="address_error" class="errMsg"><%=obj.errMsgs.Address%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Mobile </td>			    <td class="tdFieldInput">
					<input class="inputText" type="text" id="mobile" name="mobile" maxlength="20" value="<%=obj.getMobile()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="mobile_required" class="errMsg" style="display: none;">Mobile  is required</span>
					<span id="mobile_invalid" class="errMsg" style="display: none;">Mobile  is invalid</span>
                    <span id="mobile_error" class="errMsg"><%=obj.errMsgs.Mobile%></span>
				</td></tr>
			<tr class="trField">
				<td class="tdFieldName">Capacity </td>				<td class="tdFieldInput">
					<input class="inputInt" type="text" id="capacity" name="capacity" maxlength="10" value="<%=obj.getCapacity()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="capacity_required" class="errMsg" style="display: none;">Capacity  is required</span> 
					<span id="capacity_invalid" class="errMsg" style="display: none;">Capacity  is invalid</span>
                    <span id="capacity_error" class="errMsg"><%=obj.errMsgs.Capacity%></span>
                </td></tr>
			<tr class="trField">
				<td class="tdFieldName">Status </td>				<td class="tdFieldInput">
					<input class="inputInt" type="text" id="status" name="status" maxlength="10" value="<%=obj.getStatus()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="status_required" class="errMsg" style="display: none;">Status  is required</span> 
					<span id="status_invalid" class="errMsg" style="display: none;">Status  is invalid</span>
                    <span id="status_error" class="errMsg"><%=obj.errMsgs.Status%></span>
                </td></tr>
			<tr class="trField">
				<td class="tdFieldName">Is Draft </td><td class="tdFieldInput">
					<table class="tblBool">
						<tr class="trBoolSet">
							<td colspan="2" class="tdBoolSet"><input type="checkbox"
								id="ckb_is_draft" name="ckb_is_draft"
								onchange="toggleControls(['is_draft_true', 'is_draft_false'])" />Not
								set</td>
						</tr>
						<tr class="trBool">
							<td class="tdBool"><input type="radio"
								id="is_draft_true" name="is_draft" value="1"
								checked="checked" />Yes</td>
							<td class="tdBool"><input type="radio"
								id="is_draft_false" name="is_draft" value="0" />No</td>
						</tr>
					</table></td>
				<td class="tdErrMsg"></td></tr>
			<tr class="trField">
				<td class="tdFieldName">Notification </td>				<td class="tdFieldInput">
					<input class="inputInt" type="text" id="notification" name="notification" maxlength="10" value="<%=obj.getNotification()%>" />
				</td>
				<td class="tdErrMsg">
					<span id="notification_required" class="errMsg" style="display: none;">Notification  is required</span> 
					<span id="notification_invalid" class="errMsg" style="display: none;">Notification  is invalid</span>
                    <span id="notification_error" class="errMsg"><%=obj.errMsgs.Notification%></span>
                </td></tr>
			<tr class="trField">
				<td class="tdFieldName">Created </td>				<td class="tdFieldInput">
                    <span class="inputText"><%=obj.getCreated()%></span>					
				</td>
				<td class="tdErrMsg">					
                </td>			<tr class="trField">
				<td class="tdFieldName">Creator </td>				<td class="tdFieldInput">
                    <span class="inputText"><%=obj.getCreator()%></span>					
				</td>
				<td class="tdErrMsg">					
                </td>			<tr class="trField">
				<td class="tdFieldName">Updated </td>				<td class="tdFieldInput">
                    <span class="inputText"><%=obj.getUpdated()%></span>					
				</td>
				<td class="tdErrMsg">					
                </td>			<tr class="trField">
				<td class="tdFieldName">Updator </td>				<td class="tdFieldInput">
                    <span class="inputText"><%=obj.getUpdator()%></span>					
				</td>
				<td class="tdErrMsg">					
                </td>			<tr class="trField">
				<td class="tdFieldName">Deleted </td><td class="tdFieldInput">
					<table class="tblBool">
						<tr class="trBoolSet">
							<td colspan="2" class="tdBoolSet"><input type="checkbox"
								id="ckb_deleted" name="ckb_deleted"
								onchange="toggleControls(['deleted_true', 'deleted_false'])" />Not
								set</td>
						</tr>
						<tr class="trBool">
							<td class="tdBool"><input type="radio"
								id="deleted_true" name="deleted" value="1"
								checked="checked" />Yes</td>
							<td class="tdBool"><input type="radio"
								id="deleted_false" name="deleted" value="0" />No</td>
						</tr>
					</table></td>
				<td class="tdErrMsg"></td></tr>
			<tr class="trField">
				<td class="tdFieldName">Deletion Time </td>				<td class="tdFieldInput">
                    <span class="inputText"><%=obj.getDeletionTime()%></span>					
				</td>
				<td class="tdErrMsg">					
                </td>			
			<tr class="trInputBottom">
				<td class="trInputBottom" colspan="3">
					<table class="tblSubmit" align="center">
						<tr class="trSubmit">
							<td class="tdSubmit"><input type="submit" value="Submit" />
							</td>
							<td class="tdReset"><input type="reset" value="Reset" /></td>
						</tr>
					</table></td>
			</tr>
		</table>
	</form>
</body>
</html>